;;; Copyright (C) 2012-2013 Alessio Stalla

(in-package :asdf/interface)

(defclass iorek-source-file (source-file)
  ((type :initform "iorek")))

(defmethod asdf/action:perform ((o asdf:compile-op) (c iorek-source-file))
  (let ((compile (find-symbol "COMPILE" (find-package "IOREK"))))
    (let ((the-file (funcall compile (first (input-files o c)))))
      (truename the-file)))) ;;TODO handle errors, warnings...

(defmethod asdf/action:perform ((o asdf:load-op) (c iorek-source-file))
;;  (cl:load (first (input-files o c))))
  (let ((load (find-symbol "LOAD" (find-package "IOREK"))))
    (funcall load (first (input-files o c)))))

(asdf:defsystem #:iorek
  :serial t
  :description "Iorek - a modern Lisp dialect"
  :author "Alessio Stalla"
  :license ""
  :depends-on (#:fset #:bacteria #:doplus #:trivial-garbage)
  :components ((:file "packages")
               (:file "symbols")
               (:file "reader")
               (:file "printer")
               (:file "environments")
               (:file "operators")
               (:file "compiler")
               (:file "cl-integration")
               (:file "primitives")
               (:file "template")
               (:file "iorek-impl")
               (:iorek-source-file "debug")
               (:file "repl")))

